import requests
res = requests.get('https://www.xvideos.com')
outputFile = open('xvideos.txt', 'wb')
for line in res.iter_content():
	outputFile.write(line)
outputFile.close()

inputData = open('xvideos.txt')
text = inputData.readlines()
for line in text:
	indexStart = line.find('<a href="/video')
	indexEnd = line.find('"><img src')
	if((indexEnd!= -1) & (indexStart != -1)):
		newline = 'https://www.xvideos.com/' + line[indexStart + 10:indexEnd+1]
		newline = newline.replace('/0/','/')
		print(newline)
inputData.close()
				   
